home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / Grant's CGI Framework 1.0b14 / Util / ProcessUtil.h < prev    next >
C/C++ Source or Header  |  1996-04-11  |  2KB  |  84 lines

  1. #pragma once
  2. /*****
  3.  *
  4.  *    ProcessUtil.h
  5.  *
  6.  *    This is a support file for "Grant's CGI Framework".
  7.  *    Please see the license agreement that accompanies the distribution package
  8.  *    for licensing details.
  9.  *
  10.  *    Copyright ©1995,1996 by Grant Neufeld
  11.  *    grant@acm.org  grant@kagi.com
  12.  *    http://arpp.carleton.ca/grant/
  13.  *
  14.  *****/
  15.  
  16. #include <Threads.h>
  17. #include "MyConfiguration.h"
  18.  
  19.  
  20. /***  CONSTANTS  ***/
  21.  
  22. #define kProcessNoTimeout    nil
  23.  
  24.  
  25. /***  FUNCTION PROTOTYPES  ***/
  26.  
  27.     void        ProcessStartup            ( void );
  28.     
  29. p_export void    ProcessGiveTime            ( UInt32 );
  30.     
  31.     Boolean        ProcessCurrentIsFront    ( void );
  32.     Boolean        ProcessWaitUntilFront    ( unsigned long );
  33.     Boolean        ProcessIsFront            ( ProcessSerialNumber * );
  34.     OSErr        ProcessGetMyFSSpec        ( FSSpec * );
  35.     
  36. p_export void    ProcessIsMoreBusy        ( void );
  37. p_export void    ProcessIsLessBusy        ( void );
  38. p_export void    ProcessSleepSetDefault    ( UInt32 );
  39. p_export void    ProcessSleepSetBusy        ( UInt32 );
  40. p_export void    ProcessSleepDefault        ( void );
  41. p_export void    ProcessSleepBusy        ( void );
  42.     
  43.          void    ThreadStartup            ( void );
  44. p_export OSErr    ThreadYield                ( ThreadID, Boolean );
  45.  
  46. #if kStartupThreadsPreallocate > nil
  47. p_export OSErr    ThreadNewThreadFromPool    ( ThreadEntryProcPtr, void *, void **, ThreadID * );
  48.          void    ThreadFinishAllSubThreads    ( void );
  49.  
  50. p_export OSErr    ThreadSleep                ( ThreadID );
  51. p_export OSErr    ThreadWakeNext            ( void );
  52.          void    ThreadWakeAll            ( ThreadID );
  53. #endif
  54.  
  55. #define ProcessIsBackgroundOnly        (!(kCompileWithForeground))
  56.  
  57.  
  58. #if !(kCompileWithout_MY_Names)
  59. #define MyNewThreadFromPool    ThreadNewThreadFromPool
  60. #endif
  61.  
  62.  
  63. /***  EXTERNAL FUNCTION PROTOTYPES  ***/
  64.  
  65. /* this function will be called periodically from the deferred tasks
  66.     thread when the application is not busy, (or at idle time if the
  67.     thread can't be created).
  68.     It should not use much time since events may come in while it is
  69.     processing. This can be otherwise if you require the Thread Manager
  70.     and use 'ProcessGiveTime' frequently.
  71.     Note that it is possible for the deferred task thread to not be
  72.     called at all if the application is continually busy (IE. new CGI
  73.     events come in before old ones are finished so that there is no
  74.     non-busy time). This is highly unlikely, but should be taken into
  75.     account. I may provide a 'timer' mechanism in the future whereby
  76.     you could set a time by which the deferred task must be called,
  77.     even if the application is busy. */
  78. #if kCompileWithDeferredTask
  79. p_export void    CustomDeferredTask    ( void );
  80. #endif
  81.  
  82.  
  83. /***** EOF *****/
  84.